# # 1.重新操作课程中学习的所有代码
# # 2.完成教程中未实现的作业:石头剪刀布
# import random
#
# #随机获取一个0-2之间的值
#
# comp = random.randint(0,2)
#
# #用户输入：
# user = int(input("0代表石头，1代表剪刀，2代表布，请选择："))
# #用户赢
# #用户出石头
# if user == 0 and comp == 1:
#     print("用户赢")
# #用户出剪刀
# elif user == 1 and comp == 2:
#     print("用户赢")
# #
# elif user == 2 and comp ==0:
#     print("用户赢")
#
# elif user == comp :
#     print("平局")
#
# else:
#     print("用户输了")






# 3.正方形,三角形,九九乘法表
# 正方形
# b = 0
# while b < 5:
#     a  = 0
#     while a <= 4:
#         print("*",end="")
#         a+=1
#     print()
#     b+=1

# line  = 1
#
# while line <=5 :
#     n= 1
#     str1= ""
#     #循环判断
#     while n<=5:
#         str1 +="*"
#         n+=1
#     print(str1)
#     line += 1

line = 1
while line <=5 :
    n= 1
    str1= ""
    #循环判断
    while n<=line:
        str1 +="*"
        n+=1
    print(str1)
    line += 1


line = 1
while line <=5 :
    n= 1
    str1= ""
    #循环判断
    while n<=line:
        str1 +="*"
        n+=1
    print(str1.rjust(20," "))
    line += 1


line = 1
while line <=5 :
    n= 1
    str1= ""
    #循环判断
    while n<=line:
        str1 +="* "
        n+=1
    print(str1.center(20," "))
    line += 1







# x = 0
# while x <= 4:
#
#     z = 0
#     while z <= x:
#         print("*", end="")
#         z += 1
#     print()
#     x += 1

i= 1
while i <= 9 :
    o = 1
    while o <=i :
        print(f"{o}*{i} ={o * i}", end="\t")
        o+=1
    print()
    i+=1







# 3.三角形的不同样子（右对齐，正三角形）
